package com.example.advice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import java.sql.SQLException;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler({SQLException.class})
    public String process(SQLException ex) {
        return ex.getMessage();
    }
}
